package com.zy.util;

import com.zy.vo.ResponseVO;

/**
 * @author zhy
 * @date 2025/6/21 14:07
 */
public class ResponseUtil {
    public static <T> ResponseVO<T> success() {
        ResponseVO<T> responseVO = new ResponseVO<>();
        responseVO.setCode(0);
        responseVO.setMsg("success");
        return responseVO;
    }

    public static <T> ResponseVO<T> success(T t) {
        ResponseVO<T> responseVO = new ResponseVO<>();
        responseVO.setCode(0);
        responseVO.setData(t);
        responseVO.setMsg("success");
        return responseVO;
    }

    public static <T> ResponseVO<T> error(String msg) {
        ResponseVO<T> responseVO = new ResponseVO<>();
        responseVO.setCode(0);
        responseVO.setMsg(msg);
        return responseVO;
    }
}
